{% extends 'layout/default.html.twig' %}

{% block title %}{{ post.meta.title }}{% endblock %}

{% block meta %}
    <meta name="description" content="{{ post.meta.description }}" />
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li class="breadcrumb-item"><a href="{{ path('home') }}">Home</a></li>
        <li class="breadcrumb-item"><a href="{{ path('blog') }}">Blog</a></li>
        <li class="breadcrumb-item active">{{ post.title }}</li>
    </ul>
{% endblock %}

{% block content %}
    <h1>{{ post.title }}</h1>

    <div class="card mb-3">
        <div class="card-header">
            {{ post.date|date('Y-m-d') }}
        </div>
        <div class="card-body">{{ post.content|nl2br }}</div>
    </div>

    <h2>Comments</h2>

    {% for comment in post.comments %}
        <div class="card mb-3">
            <div class="card-header">
                <span class="float-right">{{ comment.date|date('Y-m-d') }}</span>
                {{ comment.author }}
            </div>
            <div class="card-body">{{ comment.text|nl2br }}</div>
        </div>
    {% endfor %}
{% endblock %}